<template>
  <div>
    <h2>请完成代码</h2>
    <p>参考返回值</p>
    <pre>
        {{ list }}
    </pre>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: {},
      userInfo: {},
    };
  },
  async mounted() {
    let response = await this.$http.get(
      "http://webcast.bytedance.com/api/bill/list"
    );
    const { data: userInfo } = await this.$http.get(
      "http://webcast.bytedance.com/api/get_user_info"
    );
    const { auth } = userInfo;

    this.userInfo = userInfo;
    this.list = response.data;

    if (!auth.includes("ORDER")) this.$router.push({ path: "/no_auth" });
  },

  // beforeRouteEnter(to, from, next) {
  //   // 在渲染该组件的对应路由被 confirm 前调用
  //   // 不！能！获取组件实例 `this`
  //   // 因为当守卫执行前，组件实例还没被创建
  // },
};
</script>